﻿/** \file
* \$Rev: 183 $
* 
* \$Date: 2010-04-14 00:34:38 +0000 (Wed, 14 Apr 2010) $
*
* \$URL: http://chorus-twitter.googlecode.com/svn/trunk/src/gui/PasswordForm.cs $
*/

using System;
using System.Windows.Forms;

namespace chorus.gui
{
	/// <summary>
	/// A simple form to ask for a password for a Twitter account.
	/// </summary>
	public partial class PasswordForm : Form
	{
		/// <summary>The username associated with this account.</summary>
		public string AccountName
		{
			set { labelPrompt.Text = value + "'s password:"; }
		}
		/// <summary>The password associated with this account.</summary>
		public string Password { get { return textPass.Text; } }

		/// <summary>The constructor.</summary>
		public PasswordForm() { InitializeComponent(); }

		/// <summary>Fired when the user clicks on the OK button.</summary>
		/// <param name="sender">The event sender.</param>
		/// <param name="e">The event parameters.</param>
		void buttonOk_Click(object sender, EventArgs e) { Close(); }

		/// <summary>Fired when the user presses a key in the password control.</summary>
		/// <param name="sender">The event sender.</param>
		/// <param name="e">The event parameters.</param>
		void textPass_KeyDown(object sender, KeyEventArgs e)
		{
			if (e.KeyCode == Keys.Enter)
				Close();
		}
	}
}
